<?php
require_once "../Common/values.php";
require_once "../Common/database.php";

if (file_exists("screenshots/" . $_FILES["file"]["name"]))
      {
      echo "<h2><center>".$_FILES["file"]["name"] . " File already exists. </h2>";
      }
    else
      {
      move_uploaded_file($_FILES["file"]["tmp_name"],
      "uploads/" . $_FILES["file"]["name"]);
	$_POST[file]=$_FILES["file"]["name"];
      echo "<h2><center>File uploaded Stored in: " . "uploads/".$_FILES["file"]["name"].'</h2>';
      
      $query="UPDATE tblJobs SET screenshot=".$_FILES['file']['name']." WHERE LogNumber=".$_GET[l];

mysql_query($query);
      }

echo '<p><center><a href="../index.php?p=kbv&l='.$_GET[l].'">Back</a>';
?>